package logmanager.view;

import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

//classe d'action de changement d'onglet
public class ActionChange implements ChangeListener {
	Principal p;

	public ActionChange(Principal p) {
		super();
		this.p = p;
	}

	public void stateChanged(ChangeEvent e) {
		int index = ((JTabbedPane)e.getSource()).getSelectedIndex();
		if(index != -1)
			p.setSelectedIndex(index);
	}

}
